const path = require("path");
const n = require('webpack-node-externals');
const merge = require('webpack-merge');
const common = require('./wpk-base.js')

module.exports = merge(common,{
    //告诉webpack打包的是服务端的  对编译结果产生影响，同样的require在服务端是不需要打包输出的，客户端需要，这样写可以减小打包量。
    target: 'node',
    mode: 'development',
    entry: path.resolve(__dirname,'src/index.js'),
    output: {
        path: path.resolve(__dirname,'dist'),
        filename: '[name].js',
    },
    externals: [n()]
})
